1. Field
The following description relates to an adaptive logging apparatus and method, and more particularly, to logging technology for updating data in a database system.
2. Description of the Related Art
When an operation such as an insert, delete, update, or other operation occurs in a database, various update patterns may need to be performed according to the how data is stored in the database.
For example, the various update patterns may include a first update pattern in which a small amount of data is updated for a page, a second update pattern in which a large amount of data is updated for a page, a third update pattern in which a small amount of data is updated for a page, and a large amount of data is updated for another page, and the like.
Because it is difficult to know or predict the situation of data stored in the database in advance, it is very difficult to predict which update pattern each transaction will exhibit.
For example, a “Music” table may consist of the following fields: Title, Artist, Album, Genre, Play Count, Favorite, and File Path. In addition, 10,000 records may be stored in the “Music” table, and the table may be stored in a database. When a user deletes records having a Play Count of “0”, for example, it is difficult to know how many of the 10,000 records have a Play Count of “0,” because the amount changes dynamically over time as new files are added, and songs are played for the first time. Accordingly, although the same query is performed (i.e. files having the Play Count of “0”), the size of deleted records varies according to the situation of data stored in the table, because files are constantly being updated.
Consequently, a data page containing the data of a record to be deleted may have various update patterns, and the most efficient logging methods for the respective update patterns may differ from each other, making it difficult to predict how data is going to be updated in the database.